home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / vm / vm-undo.el.z / vm-undo.el
Encoding:
Text File  |  1998-05-21  |  19.2 KB  |  527 lines

  1. ;;; Commands to undo message attribute changes in VM
  2. ;;; Copyright (C) 1989-1995 Kyle E. Jones
  3. ;;;
  4. ;;; This program is free software; you can redistribute it and/or modify
  5. ;;; it under the terms of the GNU General Public License as published by
  6. ;;; the Free Software Foundation; either version 1, or (at your option)
  7. ;;; any later version.
  8. ;;;
  9. ;;; This program is distributed in the hope that it will be useful,
  10. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;;; GNU General Public License for more details.
  13. ;;;
  14. ;;; You should have received a copy of the GNU General Public License
  15. ;;; along with this program; if not, write to the Free Software
  16. ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. (provide 'vm-undo)
  19.  
  20. (defun vm-set-buffer-modified-p (flag &optional buffer)
  21.   (save-excursion
  22.     (and buffer (set-buffer buffer))
  23.     (set-buffer-modified-p flag)
  24.     (vm-increment vm-modification-counter)
  25.     (intern (buffer-name) vm-buffers-needing-display-update)
  26.     (if (null flag)
  27.     (setq vm-messages-not-on-disk 0))))
  28.  
  29. (defun vm-undo-boundary ()
  30.   (if (car vm-undo-record-list)
  31.       (setq vm-undo-record-list (cons nil vm-undo-record-list))))
  32.  
  33. (defun vm-clear-expunge-invalidated-undos ()
  34.   (let ((udp vm-undo-record-list) udp-prev)
  35.     (while udp
  36.       (cond ((null (car udp))
  37.          (setq udp-prev udp))
  38.         ((and (not (eq (car (car udp)) 'vm-set-buffer-modified-p))
  39.           ;; delete flag == expunged is the
  40.           ;; indicator of an expunged message
  41.           (eq (vm-deleted-flag (car (cdr (car udp)))) 'expunged))
  42.          (cond (udp-prev (setcdr udp-prev (cdr udp)))
  43.            (t (setq vm-undo-record-list (cdr udp)))))
  44.         (t (setq udp-prev udp)))
  45.       (setq udp (cdr udp))))
  46.   (vm-clear-modification-flag-undos))
  47.         
  48. (defun vm-clear-virtual-quit-invalidated-undos ()
  49.   (let ((udp vm-undo-record-list) udp-prev)
  50.     (while udp
  51.       (cond ((null (car udp))
  52.          (setq udp-prev udp))
  53.         ((and (not (eq (car (car udp)) 'vm-set-buffer-modified-p))
  54.           ;; message-id-number == "Q" is the
  55.           ;; indicator of a dead message
  56.           (equal (vm-message-id-number-of (car (cdr (car udp)))) "Q"))
  57.          (cond (udp-prev (setcdr udp-prev (cdr udp)))
  58.            (t (setq vm-undo-record-list (cdr udp)))))
  59.         (t (setq udp-prev udp)))
  60.       (setq udp (cdr udp))))
  61.   (vm-clear-modification-flag-undos))
  62.         
  63. (defun vm-clear-modification-flag-undos ()
  64.   (let ((udp vm-undo-record-list) udp-prev)
  65.     (while udp
  66.       (cond ((null (car udp))
  67.          (setq udp-prev udp))
  68.         ((eq (car (car udp)) 'vm-set-buffer-modified-p)
  69.          (cond (udp-prev (setcdr udp-prev (cdr udp)))
  70.            (t (setq vm-undo-record-list (cdr udp)))))
  71.         (t (setq udp-prev udp)))
  72.       (setq udp (cdr udp)))
  73.     (vm-squeeze-consecutive-undo-boundaries)))
  74.  
  75. ;; squeeze out consecutive record separators left by record deletions
  76. (defun vm-squeeze-consecutive-undo-boundaries ()
  77.   (let ((udp vm-undo-record-list) udp-prev)
  78.     (while udp
  79.       (cond ((and (null (car udp)) udp-prev (null (car udp-prev)))
  80.          (setcdr udp-prev (cdr udp)))
  81.         (t (setq udp-prev udp)))
  82.       (setq udp (cdr udp)))
  83.     (if (equal '(nil) vm-undo-record-list)
  84.     (setq vm-undo-record-list nil)))
  85.   ;; for the Undo button on the menubar, if present
  86.   (and (null vm-undo-record-list)
  87.        (vm-menu-support-possible-p)
  88.        (vm-menu-xemacs-menus-p)
  89.        (vm-menu-set-menubar-dirty-flag)))
  90.         
  91. (defun vm-undo-record (sexp)
  92.   ;; for the Undo button on the menubar, if present
  93.   (and (null vm-undo-record-list)
  94.        (vm-menu-support-possible-p)
  95.        (vm-menu-xemacs-menus-p)
  96.        (vm-menu-set-menubar-dirty-flag))
  97.   (setq vm-undo-record-list (cons sexp vm-undo-record-list)))
  98.  
  99. (defun vm-undo-describe (record)
  100.   (let ((cell
  101.      (assq (car record)
  102.            '((vm-set-new-flag "new" "old")
  103.          (vm-set-unread-flag "unread" "read")
  104.          (vm-set-deleted-flag "deleted" "undeleted")
  105.          (vm-set-forwarded-flag "forwarded" "unforwarded")
  106.          (vm-set-replied-flag "answered" "unanswered")
  107.          (vm-set-redistributed-flag "redistributed" "unredistributed")
  108.          (vm-set-filed-flag "filed" "unfiled")
  109.          (vm-set-written-flag "written" "unwritten"))))
  110.     (m (nth 1 record))
  111.     labels)
  112.     (cond (cell
  113.        (message "VM Undo! %s/%s %s -> %s"
  114.             (buffer-name (vm-buffer-of m))
  115.             (vm-number-of m)
  116.             (if (nth 2 record)
  117.             (nth 2 cell)
  118.               (nth 1 cell))
  119.             (if (nth 2 record)
  120.             (nth 1 cell)
  121.               (nth 2 cell))))
  122.       ((eq (car cell) 'vm-set-labels)
  123.        (setq labels (nth 2 record))
  124.        (message "VM Undo! %s/%s %s%s"
  125.             (buffer-name (vm-buffer-of m))
  126.             (vm-number-of m)
  127.             (if (null labels)
  128.             "lost all its labels"
  129.               "labels set to ")
  130.             (if (null labels)
  131.             ""
  132.               (mapconcat 'identity labels ", ")))))))
  133.  
  134. (defun vm-undo-set-message-pointer (record)
  135.   (if (and (not (eq (car record) 'vm-set-buffer-modified-p))
  136.        (not (eq (nth 1 record) vm-message-pointer)))
  137.       (progn
  138.     (vm-record-and-change-message-pointer
  139.      vm-message-pointer
  140.      (or (cdr (vm-reverse-link-of (nth 1 record)))
  141.          vm-message-list))
  142.     ;; make folder read-only to avoid modifications when we
  143.     ;; do this.
  144.     (let ((vm-folder-read-only t))
  145.       (vm-preview-current-message)))))
  146.  
  147. (defun vm-undo ()
  148.   "Undo last change to message attributes in the current folder.
  149. Consecutive invocations of this command cause sequentially earlier
  150. changes to be undone.  After an intervening command between undos,
  151. the undos themselves become undoable."
  152.   (interactive)
  153.   (vm-select-folder-buffer)
  154.   (vm-check-for-killed-summary)
  155.   (vm-error-if-folder-read-only)
  156.   (vm-display nil nil '(vm-undo) '(vm-undo))
  157.   (let ((modified (buffer-modified-p)))
  158.     (if (not (eq last-command 'vm-undo))
  159.     (setq vm-undo-record-pointer vm-undo-record-list))
  160.     (if (not vm-undo-record-pointer)
  161.     (error "No further VM undo information available"))
  162.     ;; skip current record boundary
  163.     (setq vm-undo-record-pointer (cdr vm-undo-record-pointer))
  164.     (while (car vm-undo-record-pointer)
  165.       (vm-undo-set-message-pointer (car vm-undo-record-pointer))
  166.       (vm-undo-describe (car vm-undo-record-pointer))
  167.       (eval (car vm-undo-record-pointer))
  168.       (setq vm-undo-record-pointer (cdr vm-undo-record-pointer)))
  169.     (and modified (not (buffer-modified-p))
  170.      (delete-auto-save-file-if-necessary))
  171.     (vm-update-summary-and-mode-line)))
  172.  
  173. (defun vm-set-message-attributes (string count)
  174.   "Set message attributes.
  175. Use this command to change attributes like `deleted' or
  176. `replied'.  Interactively you will be prompted for the attributes
  177. to be changed, and only the attributes you enter will be altered.
  178. You can use completion to expand the attribute names.  The names
  179. should be entered as a space separated list.
  180.  
  181. A numeric prefix argument COUNT causes the current message and
  182. the next COUNT-1 message to have their attributes altered.  A
  183. negative COUNT arg causes the current message and the previous
  184. COUNT-1 messages to be altered.  COUNT defaults to one."
  185.   (interactive
  186.    (let ((last-command last-command)
  187.      (this-command this-command))
  188.      ;; so the user can see what message they are about to
  189.      ;; modify.
  190.      (vm-follow-summary-cursor)
  191.      (list
  192.       (vm-read-string "Set attributes: " vm-supported-attribute-names t)
  193.       (prefix-numeric-value current-prefix-arg))))
  194.   (vm-follow-summary-cursor)
  195.   (vm-select-folder-buffer)
  196.   (vm-check-for-killed-summary)
  197.   (vm-error-if-folder-read-only)
  198.   (vm-error-if-folder-empty)
  199.   (vm-display nil nil '(vm-set-message-attributes)
  200.           '(vm-set-message-attributes))
  201.   (let ((name-list (vm-parse string "[ \t]*\\([^ \t]+\\)"))
  202.     (m-list (vm-select-marked-or-prefixed-messages count))
  203.     n-list name m)
  204.     (while m-list
  205.       (setq m (car m-list)
  206.         n-list name-list)
  207.       (while n-list
  208.     (setq name (car n-list))
  209.     (cond ((string= name "new")
  210.            (vm-set-new-flag m t))
  211.           ((string= name "recent")
  212.            (vm-set-new-flag m t))
  213.           ((string= name "unread")
  214.            (vm-set-unread-flag m t))
  215.           ((string= name "unseen")
  216.            (vm-set-unread-flag m t))
  217.           ((string= name "read")
  218.            (vm-set-new-flag m nil)
  219.            (vm-set-unread-flag m nil))
  220.           ((string= name "deleted")
  221.            (vm-set-deleted-flag m t))
  222.           ((string= name "replied")
  223.            (vm-set-replied-flag m t))
  224.           ((string= name "answered")
  225.            (vm-set-replied-flag m t))
  226.           ((string= name "forwarded")
  227.            (vm-set-forwarded-flag m t))
  228.           ((string= name "redistributed")
  229.            (vm-set-redistributed-flag m t))
  230.           ((string= name "filed")
  231.            (vm-set-filed-flag m t))
  232.           ((string= name "written")
  233.            (vm-set-written-flag m t))
  234.           ((string= name "edited")
  235.            (vm-set-edited-flag-of m t))
  236.           ((string= name "undeleted")
  237.            (vm-set-deleted-flag m nil))
  238.           ((string= name "unreplied")
  239.            (vm-set-replied-flag m nil))
  240.           ((string= name "unanswered")
  241.            (vm-set-replied-flag m nil))
  242.           ((string= name "unforwarded")
  243.            (vm-set-forwarded-flag m nil))
  244.           ((string= name "unredistributed")
  245.            (vm-set-redistributed-flag m nil))
  246.           ((string= name "unfiled")
  247.            (vm-set-filed-flag m nil))
  248.           ((string= name "unwritten")
  249.            (vm-set-written-flag m nil))
  250.           ((string= name "unedited")
  251.            (vm-set-edited-flag-of m nil)))
  252.     (setq n-list (cdr n-list)))
  253.       (setq m-list (cdr m-list)))
  254.     (vm-update-summary-and-mode-line)))
  255.  
  256. (defun vm-add-message-labels (string count)
  257.   "Attach some labels to a message.
  258. These are arbitrary user-defined labels, not to be confused with
  259. message attributes like `new' and `deleted'.  Interactively you
  260. will be prompted for the labels to be added.  You can use
  261. completion to expand the label names, with the completion list
  262. being all the labels that have ever been used in this folder.
  263. The names should be entered as a space separated list.  Label
  264. names are compared case-insensitively.
  265.  
  266. A numeric prefix argument COUNT causes the current message and
  267. the next COUNT-1 message to have the labels added.  A
  268. negative COUNT arg causes the current message and the previous
  269. COUNT-1 messages to be altered.  COUNT defaults to one."
  270.   (interactive
  271.    (let ((last-command last-command)
  272.      (this-command this-command)
  273.      (vm-completion-auto-correct nil)
  274.      (completion-ignore-case t))
  275.      ;; so the user can see what message they are about to
  276.      ;; modify.
  277.      (vm-follow-summary-cursor)
  278.      (vm-select-folder-buffer)
  279.      (list
  280.       (vm-read-string "Add labels: "
  281.               (vm-obarray-to-string-list vm-label-obarray) t)
  282.       (prefix-numeric-value current-prefix-arg))))
  283.   (vm-follow-summary-cursor)
  284.   (vm-select-folder-buffer)
  285.   (vm-check-for-killed-summary)
  286.   (vm-error-if-folder-read-only)
  287.   (vm-error-if-folder-empty)
  288.   (vm-add-or-delete-message-labels string count 'all))
  289.  
  290. (defun vm-add-existing-message-labels (string count)
  291.   "Attach some already existing labels to a message.
  292. Only labels that are currently attached to some message in this
  293. folder or labels that have previously been attached to messages
  294. in this folder will be added.  Other labels will be silently
  295. ignored.
  296.  
  297. These are arbitrary user-defined labels, not to be confused with
  298. message attributes like `new' and `deleted'.  Interactively you
  299. will be prompted for the labels to be added.  You can use
  300. completion to expand the label names, with the completion list
  301. being all the labels that have ever been used in this folder.
  302. The names should be entered as a space separated list.  Label
  303. names are compared case-insensitively.
  304.  
  305. A numeric prefix argument COUNT causes the current message and
  306. the next COUNT-1 message to have the labels added.  A
  307. negative COUNT arg causes the current message and the previous
  308. COUNT-1 messages to be altered.  COUNT defaults to one."
  309.   (interactive
  310.    (let ((last-command last-command)
  311.      (this-command this-command)
  312.      (vm-completion-auto-correct nil)
  313.      (completion-ignore-case t))
  314.      ;; so the user can see what message they are about to
  315.      ;; modify.
  316.      (vm-follow-summary-cursor)
  317.      (vm-select-folder-buffer)
  318.      (list
  319.       (vm-read-string "Add labels: "
  320.               (vm-obarray-to-string-list vm-label-obarray) t)
  321.       (prefix-numeric-value current-prefix-arg))))
  322.   (vm-follow-summary-cursor)
  323.   (vm-select-folder-buffer)
  324.   (vm-check-for-killed-summary)
  325.   (vm-error-if-folder-read-only)
  326.   (vm-error-if-folder-empty)
  327.   (let ((ignored-labels
  328.      (vm-add-or-delete-message-labels string count 'existing-only)))
  329.     (if ignored-labels
  330.     (progn
  331.       (set-buffer (get-buffer-create "*Ignored Labels*"))
  332.       (erase-buffer)
  333.       (insert "These labels do not exist and were not added:\n\n")
  334.       (while ignored-labels
  335.         (insert (car ignored-labels) "\n")
  336.         (setq ignored-labels (cdr ignored-labels)))
  337.       (display-buffer (current-buffer))))))
  338.  
  339. (defun vm-delete-message-labels (string count)
  340.   "Delete some labels from a message.
  341. These are arbitrary user-defined labels, not to be confused with
  342. message attributes like `new' and `deleted'.  Interactively you
  343. will be prompted for the labels to be deleted.  You can use
  344. completion to expand the label names, with the completion list
  345. being all the labels that have ever been used in this folder.
  346. The names should be entered as a space separated list.  Label
  347. names are compared case-insensitively.
  348.  
  349. A numeric prefix argument COUNT causes the current message and
  350. the next COUNT-1 message to have the labels deleted.  A
  351. negative COUNT arg causes the current message and the previous
  352. COUNT-1 messages to be altered.  COUNT defaults to one."
  353.   (interactive
  354.    (let ((last-command last-command)
  355.      (this-command this-command)
  356.      (vm-completion-auto-correct nil)
  357.      (completion-ignore-case t))
  358.      ;; so the user can see what message they are about to
  359.      ;; modify.
  360.      (vm-follow-summary-cursor)
  361.      (vm-select-folder-buffer)
  362.      (list
  363.       (vm-read-string "Delete labels: "
  364.               (vm-obarray-to-string-list vm-label-obarray) t)
  365.       (prefix-numeric-value current-prefix-arg))))
  366.   (vm-follow-summary-cursor)
  367.   (vm-select-folder-buffer)
  368.   (vm-check-for-killed-summary)
  369.   (vm-error-if-folder-read-only)
  370.   (vm-error-if-folder-empty)
  371.   (vm-add-or-delete-message-labels string count nil))
  372.  
  373. (defun vm-add-or-delete-message-labels (string count add)
  374.   (vm-display nil nil '(vm-add-message-labels vm-delete-message-labels)
  375.           (list this-command))
  376.   (setq string (downcase string))
  377.   (let ((m-list (vm-select-marked-or-prefixed-messages count))
  378.     (action-labels (vm-parse string
  379. "[\000-\040,\177-\377]*\\([^\000-\040,\177-\377]+\\)[\000-\040,\177-\377]*"))
  380.     labels act-labels)
  381.     (if (and add m-list)
  382.     (if (eq add 'all)
  383.         (progn
  384.           (setq act-labels action-labels)
  385.           (while act-labels
  386.         (intern (car act-labels) vm-label-obarray)
  387.         (setq act-labels (cdr act-labels))))
  388.       (let ((newlist nil))
  389.         (setq act-labels action-labels)
  390.         (while act-labels
  391.           (if (intern-soft (car act-labels) vm-label-obarray)
  392.           (setq newlist (cons (car act-labels) newlist)))
  393.           (setq act-labels (cdr act-labels)))
  394.         (setq action-labels newlist))))
  395.     (while m-list
  396.       (setq act-labels action-labels
  397.         labels (copy-sequence (vm-labels-of (car m-list))))
  398.       (if add
  399.       (while act-labels
  400.         (setq labels (cons (car act-labels) labels)
  401.           act-labels (cdr act-labels)))
  402.     (while act-labels
  403.       (setq labels (vm-delqual (car act-labels) labels)
  404.         act-labels (cdr act-labels))))
  405.       (if add
  406.       (setq labels (vm-delete-duplicates labels)))
  407.       (vm-set-labels (car m-list) labels)
  408.       (setq m-list (cdr m-list))))
  409.   (vm-update-summary-and-mode-line))
  410.  
  411. (defun vm-set-xxxx-flag (m flag norecord function attr-index)
  412.   (let ((m-list nil) vmp)
  413.     (cond
  414.      ((and (not vm-folder-read-only)
  415.        (or (not (vm-virtual-messages-of m))
  416.            (not (save-excursion
  417.               (set-buffer
  418.                (vm-buffer-of
  419.              (vm-real-message-of m)))
  420.               vm-folder-read-only))))
  421.       (cond
  422.        ((not norecord)
  423.     (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m)))
  424.     (while vmp
  425.       (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp)))
  426.           (setq m-list (cons (car vmp) m-list)))
  427.       (setq vmp (cdr vmp)))
  428.     (if (null m-list)
  429.         (setq m-list (cons m m-list)))
  430.     (while m-list
  431.       (save-excursion
  432.         (set-buffer (vm-buffer-of (car m-list)))
  433.         (cond ((not (buffer-modified-p))
  434.            (vm-set-buffer-modified-p t)
  435.            (vm-undo-record (list 'vm-set-buffer-modified-p nil))))
  436.         (vm-undo-record (list function (car m-list) (not flag)))
  437.         (vm-undo-boundary)
  438.         (vm-increment vm-modification-counter))
  439.       (setq m-list (cdr m-list)))))
  440.       (aset (vm-attributes-of m) attr-index flag)
  441.       (vm-mark-for-summary-update m)
  442.       (if (not norecord)
  443.       (if (eq vm-flush-interval t)
  444.           (vm-stuff-virtual-attributes m)
  445.         (vm-set-modflag-of m t)))))))
  446.  
  447.  
  448. (defun vm-set-labels (m labels)
  449.   (let ((m-list nil)
  450.     (old-labels (vm-labels-of m))
  451.     vmp)
  452.     (cond
  453.      ((and (not vm-folder-read-only)
  454.        (or (not (vm-virtual-messages-of m))
  455.            (not (save-excursion
  456.               (set-buffer
  457.                (vm-buffer-of
  458.              (vm-real-message-of m)))
  459.               vm-folder-read-only))))
  460.       (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m)))
  461.       (while vmp
  462.     (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp)))
  463.         (setq m-list (cons (car vmp) m-list)))
  464.     (setq vmp (cdr vmp)))
  465.       (if (null m-list)
  466.       (setq m-list (cons m m-list)))
  467.       (while m-list
  468.     (save-excursion
  469.       (set-buffer (vm-buffer-of (car m-list)))
  470.       (cond ((not (buffer-modified-p))
  471.          (vm-set-buffer-modified-p t)
  472.          (vm-undo-record (list 'vm-set-buffer-modified-p nil))))
  473.       (vm-undo-record (list 'vm-set-labels m old-labels))
  474.       (vm-undo-boundary)
  475.       (vm-increment vm-modification-counter))
  476.     (setq m-list (cdr m-list)))
  477.       (vm-set-labels-of m labels)
  478.       (vm-set-label-string-of m nil)
  479.       (vm-mark-for-summary-update m)
  480.       (if (eq vm-flush-interval t)
  481.       (vm-stuff-virtual-attributes m)
  482.     (vm-set-modflag-of m t))))))
  483.  
  484.  
  485. (defun vm-set-new-flag (m flag &optional norecord)
  486.   (vm-set-xxxx-flag m flag norecord 'vm-set-new-flag 0))
  487.  
  488. (defun vm-set-unread-flag (m flag &optional norecord)
  489.   (vm-set-xxxx-flag m flag norecord 'vm-set-unread-flag 1))
  490.  
  491. (defun vm-set-deleted-flag (m flag &optional norecord)
  492.   (vm-set-xxxx-flag m flag norecord 'vm-set-deleted-flag 2))
  493.  
  494. (defun vm-set-filed-flag (m flag &optional norecord)
  495.   (vm-set-xxxx-flag m flag norecord 'vm-set-filed-flag 3))
  496.  
  497. (defun vm-set-replied-flag (m flag &optional norecord)
  498.   (vm-set-xxxx-flag m flag norecord 'vm-set-replied-flag 4))
  499.  
  500. (defun vm-set-written-flag (m flag &optional norecord)
  501.   (vm-set-xxxx-flag m flag norecord 'vm-set-written-flag 5))
  502.  
  503. (defun vm-set-forwarded-flag (m flag &optional norecord)
  504.   (vm-set-xxxx-flag m flag norecord 'vm-set-forwarded-flag 6))
  505.  
  506. (defun vm-set-redistributed-flag (m flag &optional norecord)
  507.   (vm-set-xxxx-flag m flag norecord 'vm-set-forwarded-flag 8))
  508.  
  509. ;; use these to avoid undo and summary update.
  510. (defun vm-set-new-flag-of (m flag) (aset (aref m 2) 0 flag))
  511. (defun vm-set-unread-flag-of (m flag) (aset (aref m 2) 1 flag))
  512. (defun vm-set-deleted-flag-of (m flag) (aset (aref m 2) 2 flag))
  513. (defun vm-set-filed-flag-of (m flag) (aset (aref m 2) 3 flag))
  514. (defun vm-set-replied-flag-of (m flag) (aset (aref m 2) 4 flag))
  515. (defun vm-set-written-flag-of (m flag) (aset (aref m 2) 5 flag))
  516. (defun vm-set-forwarded-flag-of (m flag) (aset (aref m 2) 6 flag))
  517. (defun vm-set-redistributed-flag-of (m flag) (aset (aref m 2) 8 flag))
  518.  
  519. ;; this is solely for the use of vm-stuff-attributes and appears here
  520. ;; only because this function should be grouped with others of its kind
  521. ;; for maintenance purposes.
  522. (defun vm-set-deleted-flag-in-vector (v flag)
  523.   (aset v 2 flag))
  524. ;; ditto.  this is for vm-read-attributes.
  525. (defun vm-set-new-flag-in-vector (v flag)
  526.   (aset v 0 flag))
  527.